package org.springframework.remoting.jsonrpc.test.account;


import java.util.ArrayList;
import java.util.List;

//... and corresponding implement doing nothing at the moment
public class AccountServiceImpl implements AccountService {

  public void addAccount(Customer customer) {
    return;
  }

  public void insertAccount(Account acc) {
    System.out.println(acc);
  }

  public List getAccounts(AccountName name) {
    Account account = new Account();
    account.setName(name);
    account.setId(new AccountId(1));
    List list = new ArrayList();
    list.add(account);
    return list;
  }

  public Account[] getAccountArray(AccountId id) {
    AccountName name = new AccountName();
    name.setName("whatever");
    List accounts = getAccounts(name);
    Account[] accountArray = (Account[]) (accounts.toArray(new Account[accounts.size()]));
    return accountArray;
  }

  public Account getAccount(AccountId id) {
    Account account = new Account();
    account.setId(id);
    account.setName(new AccountName("name-o"));
    return account;
  }
}
